<template>
  <div>
    <el-table :data="list" style="width: 100%">
      <el-table-column v-if="id_card === '超级管理员'" prop="ip" label="ip" width="120">
      </el-table-column>
       <el-table-column v-if="id_card !== '用户'"  prop="name" label="姓名" width="120">
      </el-table-column>
      <el-table-column prop="punctuality" label="进班" width="180">
        <template slot-scope="scope">
          <span v-if="scope.row.punctuality === 1">提前进班</span>
          <span v-if="scope.row.punctuality === 2">准时进班</span>
          <span v-if="scope.row.punctuality === 3">偶尔迟到</span>
          <span v-if="scope.row.punctuality === 4">经常迟到</span>
        </template>
      </el-table-column>
      <el-table-column prop="work" label="作业" width="120">
        <template slot-scope="scope">
          <span v-if="scope.row.work === 1">作业充足</span>
          <span v-if="scope.row.work === 2">作业过少</span>
          <span v-if="scope.row.work === 3">偶尔布置</span>
          <span v-if="scope.row.work === 4">不布置</span>
        </template>
      </el-table-column>
      <el-table-column prop="review" label="复习">
        <template slot-scope="scope">
          <span v-if="scope.row.work === 1">每天复习</span>
          <span v-if="scope.row.work === 2">经常复习</span>
          <span v-if="scope.row.work === 3">偶尔复习</span>
          <span v-if="scope.row.work === 4">不复习</span>
        </template>
      </el-table-column>
      <el-table-column prop="textarea" label="意见"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
import axios from "@/http";
export default {
  data() {
    return {
      list: [],
      id_card: ""
    };
  },
  created() {
    axios.get('/user/getUserInfo').then(res => {
      this.id_card = res.data[0].id_card
    })

    axios.get("/search").then((res) => {
      this.list = res.data
    });
  },
};
</script>

<style>
</style>